package com.gao.xml.jackson.xml;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlCData;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

/**
 * @author GaoXi
 * @date 2021/8/18 15:46
 */

@JacksonXmlRootElement(localName = "myUser")
public class User {
/*    @JacksonXmlCData
    @JacksonXmlProperty(isAttribute = false, localName = "name")
    private String name = "gaoxi";
    @JacksonXmlProperty(isAttribute = true, localName = "value")
    private String value = "2";
    @JacksonXmlProperty
    private IdEntity id = new IdEntity();*/

    @JacksonXmlElementWrapper(useWrapping = false)
    @JacksonXmlProperty
    private List<String> hobby = Arrays.asList("sing","dance","basketball");
}
